package marcus.com.immersivemode;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{

    private Button ImageImmersive;
    private Button ColorImmersive;
    private Intent intent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ImageImmersive = (Button) findViewById(R.id.button1);
        ColorImmersive = (Button) findViewById(R.id.button2);
        ImageImmersive.setOnClickListener(this);
        ColorImmersive.setOnClickListener(this);

    }

    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.button1:
                intent = new Intent(MainActivity.this, ColorImmersiveActivity.class);
                startActivity(intent);
                break;
            case R.id.button2:
                intent = new Intent(MainActivity.this, ImageImmersiveActivity.class);
                startActivity(intent);
                break;
        }
    }
}
